﻿CommandInfo = function (commandParameters) {
    var parms = commandParameters.split(" ");
    var commandBase = parms[0];

    // pull the prefixes off of the command
    var commandParts = this.stripPrefixes(commandBase.split("."));
    this.Name = commandParts[0];

    // modifiers are the trailing pieces of the command (e.g., for ldc.i4, modifier = i4) 
    this.Modifiers = [];
    for (var i = 1; i < commandParts.length; i++) {
        this.Modifiers.push(commandParts[i]);
    }

    // arguments are parameters to the command
    this.Arguments = [];
    for (var j = 1; j < parms.length; j++) {
        this.Arguments.push(parms[j]);
    }
};

CommandInfo.prototype.stripPrefixes = function (commandParts) {
    // for now, just ignore
    return commandParts;
};